package com.itLrg.blog.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;


public class LoginWidget extends Composite
{

   private static LoginWidgetUiBinder uiBinder = GWT.create(LoginWidgetUiBinder.class);

   interface LoginWidgetUiBinder extends UiBinder<Widget, LoginWidget>
   {
   }

   public LoginWidget()
   {
      initWidget(uiBinder.createAndBindUi(this));
   }

   @UiField
   Button loginButton;

   public LoginWidget(String firstName)
   {
      initWidget(uiBinder.createAndBindUi(this));
      loginButton.setText(firstName);
   }

   @UiHandler("loginButton")
   void onClick(ClickEvent e)
   {
      Window.alert("Hello!");
   }
}
